/*
 * @Descripttion: 
 * @version: 
 * @Author: guangyunl
 * @Date: 2023-12-02 23:20:46
 * @LastEditors: guangyunl
 * @LastEditTime: 2024-03-22 18:51:17
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store/index'

import api from './api'
Vue.prototype.$api = api

import dayjs from 'dayjs'
Vue.prototype.$dayjs = dayjs

import auth from './util/auth'
Vue.use(auth)

import cookies from 'vue-cookies'
Vue.use(cookies)

import VueMeta from 'vue-meta'
Vue.use(VueMeta)

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

import hotkeys from 'hotkeys-js'
Vue.prototype.$hotkeys = hotkeys

// 全局组件自动注册
import './components/autoRegister'

// 自动加载 svg 图标
const req = require.context('./assets/icons', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)

import './assets/styles/reset.scss'

import './mock'

import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'
import AvueUeditor from 'avue-plugin-ueditor'
Vue.use(Avue)

Vue.use(AvueUeditor);
Vue.config.productionTip = false

// 创建一个Vue实例，并将其挂载到#app节点上
Vue.prototype.$eventBus = new Vue({
    // 添加路由
    router,
    // 添加状态管理
    store,
    // 渲染App组件
    render: h => h(App)
}).$mount('#app')